<?php
/**
 * Created by PhpStorm.
 * User: yanghe
 * Date: 2016/3/20
 * Time: 11:29
 */
namespace App\Http\Controllers\Test;

use MyClass\Base\Album;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Session;

class AlbumController extends Controller
{
    public function addTest()
    {
        session(["user_id"=>1]);
        $data=Album::add("你好",1);
        $data=json_decode($data);
        dd($data);
    }
    public function selectTest()
    {
        session(["user_id"=>1]);
        $data=Album::select();
        $data=json_decode($data);
        dd($data);
    }
    public function updateTest()
    {
        $data["album_name"]="李作强傻逼";
        $a=new Album(1);
        $result=$a->update($data);
        $d=json_decode($result);
        dd($d);
    }
    public function deleteTest($album_id)
    {
        session(["user_id"=>1]);
        $a=new Album($album_id);
        $result=$a->delete();
        $d=json_decode($result);
        dd($d);

    }
}